﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Portal/Master/Portal.Master" AutoEventWireup="true" CodeBehind="FindUserPwdList2.aspx.cs" Inherits="Besture.UI.Portal.FindUserPwd.FindUserPwdList2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="stylesheet" href="/Resource/css/normalize.css"/>
    <link rel="stylesheet" href="/Resource/css/common.css"/>
    <link rel="stylesheet" href="/Resource/css/base.css"/>
    <link href="/Resource/css/index.css" rel="stylesheet" />  
    <style>
        .submitbtn {background-color: #b10b4b;color: #fff !important;border: none;padding: 8px 40px;border-radius: 3px;font-size: 14px;}
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Content" runat="server">
    <div class="main">
            <div class="findpwd-page">
                <div class="tab1 clearfix" target=".findbox">
                     <a href="EmailFindOne.aspx" class="email ">邮箱找回</a>
                <a href="FindUserPwdList1.aspx" class="phone active">手机找回</a>
                </div>
                <div class="findbox"> 
                    <!--手机找回-->
                    <div class="phone-tip">
                        <p>
                            短信验证码已经发送到您的手机<b runat="server" id="phone">138******13</b>上，请在下框中输入验证码：
                        </p>
                        <p>
                            验证码&nbsp;&nbsp;<asp:TextBox ID="txtVerificationCode" runat="server" placeholder="输入验证码" Style="width: 115px;"></asp:TextBox>
                        </p>
                        <p>
                            <a href="javascript:void(0)" class="sms">重新发送验证码</a>
                        </p>
                        <p>
                            <asp:LinkButton ID="btnSub" runat="server" class="submitbtn" Text="下一步" OnClick="btnSub_Click"></asp:LinkButton>
                        </p>
                    </div>
                </div>
            </div>
        </div>
    <asp:HiddenField ID="hidPhone" runat="server" />
    <script type="text/javascript">

        /*
        *校验邮箱是否填写
        */

        var t;
        var Send = true;
        $(function () {
            $(".sms").click(function () {
                if (Send) {
                    var phone = $("#<%=hidPhone.ClientID %>").val();
                    if (phone != "" && !/^0{0,1}(13[0-9]|14[0-9]|15[0-9]|17[0-9]|18[0-9])[0-9]{8}$/.test(phone)) {
                        return;
                    } else {
                        //$.ajax({
                        //    async: true,
                        //    type: "GET",
                        //    url: "/User/Utils/ajax.aspx?type=sms&only=" + phone,
                        //    success: function (data) {

                        //    }
                        //});
                        //发送验证码倒计时
                        t = setInterval(timer, 1000);
                        Send = false;
                    }
                }
            });
            $(".sms").click();
        });

        //邮箱验证时间计时
        var sumSecond = 59;
        var scrollTimer = 0;
        function timer() {
            if (sumSecond <= 0) {
                $(".sms").text("重新发送");
                clearInterval(t);
                sumSecond = 59;
                scrollTimer = 0;
                Send = true;
                return 0;
            }
            if (scrollTimer > 0) {

                $(".sms").text(scrollTimer + 1 + "分钟后重发");
            }
            else {
                $(".sms").text(sumSecond + "秒后重发");
            }
            sumSecond -= 1;
            if (sumSecond / 60 == scrollTimer) {
                scrollTimer -= 1;
            }
        }

    </script>
</asp:Content>
